<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>留言板</title>
</head>
<body>
<div id="liu"></div></br>
<div>用户：<input type="text" id="name" name="username"></div></br>
<div>留言：<textarea id="content" name="content"></textarea></div></br>
<div><button>提交</button></div>

<script src="js/jquery-1.11.1.min.js"></script>
<script>
    $("button").click(function () {
        var username=$("#name").val();
        var content=$("#content").val();
        $.post("test.php",{username:username,content:content},function (data) {
            $("#liu").append(data);
        },"html")
    })
</script>

</body>
</html>